package com.manager.car.action;

import java.util.List;

import com.manager.car.po.DemandInfo;
import com.manager.car.service.IDemandInfoService;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class DemandInfoAtion extends ActionSupport{

	private static final long serialVersionUID = 1L;
    private IDemandInfoService demandInfoService; 
    private DemandInfo di;
    private Integer id;
    
    public String queryAll() {
    	List<DemandInfo> list = demandInfoService.queryAll();
    	ActionContext.getContext().put("list", list);
		return "list";
    }
    public String add() {
    	demandInfoService.add(di);
    	return "add";
    }
    public String queryId() {
    	DemandInfo demandInfo = demandInfoService.queryId(id);
    	ActionContext.getContext().put("queryId", demandInfo);
    	return "queryId";
    }
    public String edit() {
    	demandInfoService.update(di);
    	return "edit";
    }
    public String delete() {
    	demandInfoService.delete(id);
    	return "delete";
    }
	public IDemandInfoService getDemandInfoService() {
		return demandInfoService;
	}
	public void setDemandInfoService(IDemandInfoService demandInfoService) {
		this.demandInfoService = demandInfoService;
	}
	public DemandInfo getDi() {
		return di;
	}
	public void setDi(DemandInfo di) {
		this.di = di;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
    
    
}
